#!/usr/bin/python
# coding:utf-8
# auther:DT
# 2017-08-09_03-39-22

import os
py_list = []
p_path = input("请输入你想遍历的路径（需要绝对路径）:")
end_name = input("请输入你想统计的文件后缀名(.py)：")
bl = os.walk(p_path)
for path, d_name, f_name in bl:
    for i in f_name:
        if i.endswith(end_name):
            print(os.path.join(path, i))
            py_list.append(os.path.join(path, i))
print(len(py_list))
